.home-container {
  display: flex;
  min-height: 100vh;
  background: #f8f9fa;
  font-family: 'Segoe UI', Roboto, sans-serif;
}

.main-content {
  flex: 1;
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.header {
  margin-bottom: 32px;
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-top: 16px;
}

.user-container {
  position: relative;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #4a6cf7;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.user-avatar:hover {
  transform: scale(1.05);
}

.user-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 8px 0;
  z-index: 100;
  display: none;
  min-width: 120px;
}

.user-container:hover .user-dropdown {
  display: block;
}

.user-dropdown-item {
  padding: 8px 16px;
  cursor: pointer;
  color: #495057;
  font-size: 14px;
}

.user-dropdown-item:hover {
  background: #f8f9fa;
}

.header h1 {
  color: #2c3e50;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.add-task-btn {
  background: #4a6cf7;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.add-task-btn:hover {
  background: #3a5bd9;
}

.tasks-container {
  margin-top: 24px;
}

.tasks-section {
  margin-bottom: 32px;
}

.tasks-section h2 {
  color: #495057;
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e9ecef;
}

.tasks-list {
  display: grid;
  gap: 12px;
}

.task-item {
  background: white;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  align-items: flex-start;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: all 0.2s;
  max-width: 100%; /* 限制最大宽度 */
}

.task-item:hover {
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.task-item.completed {
  opacity: 0.7;
}

.task-status {
  margin-right: 16px;
  margin-top: 2px;
  display: flex;
  align-items: center;
  padding: 8px;
  border-radius: 4px;
}

.task-status:hover {
  background-color: #f5f7fa;
}

.task-status :deep(.el-checkbox) {
  height: auto;
}

.task-content {
  flex: 1;
  cursor: pointer;
  min-width: 0; /* 允许内容区域收缩 */
}

.task-title {
  font-weight: 500;
  color: #212529;
  margin-bottom: 4px;
  word-wrap: break-word; /* 允许长单词换行 */
  word-break: break-word; /* 允许在适当位置换行 */
}

.task-description {
  color: #6c757d;
  font-size: 14px;
  margin-bottom: 4px;
  word-wrap: break-word;
  word-break: break-word;
}

.task-due-date {
  color: #868e96;
  font-size: 13px;
}

.task-actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .task-actions {
  opacity: 1;
}

.task-actions :deep(.el-button) {
  background: none;
  border: none;
  color: #868e96;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  min-width: auto; /* 修复按钮宽度问题 */
}

.task-actions :deep(.el-button):hover {
  color: #495057;
  background: rgba(0,0,0,0.05);
}

.empty-state {
  color: #adb5bd;
  text-align: center;
  padding: 24px;
  font-size: 14px;
}

.welcome-message {
  text-align: center;
  padding: 64px 24px;
}

.welcome-message h2 {
  color: #2c3e50;
  font-size: 24px;
  margin-bottom: 16px;
}

.welcome-message p {
  color: #6c757d;
  font-size: 16px;
  margin-bottom: 24px;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  margin: 0 20px;
}

@media (min-width: 769px) {
  .modal-content {
    max-width: 500px;
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: #2c3e50;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #666;
}

.modal-body {
  padding: 24px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  color: #495057;
  font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: #67c23a;
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

.modal-footer {
  padding: 16px 24px 24px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.modal-footer button {
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.cancel-btn {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  color: #495057;
}

.cancel-btn:hover {
  background: #e9ecef;
}

.save-btn {
  background: #4a6cf7;
  color: white;
  border: none;
}

.save-btn:hover {
  background: #3a5bd9;
}

.save-btn:disabled {
  background: #adb5bd;
  cursor: not-allowed;
}

.delete-btn {
  background: #fa5252;
  color: white;
  border: none;
}

.delete-btn:hover {
  background: #e03131;
}

.delete-confirm-modal .modal-content {
  max-width: 400px;
}

.delete-confirm-modal .modal-body {
  text-align: center;
  padding: 32px 24px;
}

.delete-confirm-modal .modal-body i {
  font-size: 48px;
  color: #f56c6c;
  margin-bottom: 16px;
}

.delete-confirm-modal .modal-body p {
  margin: 0 0 24px 0;
  color: #606266;
  font-size: 16px;
}

@media (max-width: 768px) {
  .main-content {
    padding: 24px 16px;
  }
  
  .header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  
  .header h1 {
    font-size: 20px;
  }
  
  .add-task-btn {
    width: 100%;
    justify-content: center;
  }
}